<script>
export default {
  name: 'MultiDelete',
  data() {
    return {
      key: 'id',//
      ids: []// 选中数组
    }
  },
  computed: {
    showBatch: function() {
      return !!this.ids.length
    }
  },
  methods: {
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item[this.key])
      this.multiple = !selection.length
    }
  }
}
</script>
